package com.my.myrecorder;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.my.myrecorder.Fragment.FragmentContainerActivity;
import com.my.myrecorder.NXTest.FormAudioTopActivity;
import com.my.myrecorder.NXTest.RecorderService;

import java.io.File;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private TextView tv;

    //参考
//    http://blog.csdn.net/u014657752/article/details/48009325
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        startActivity(new Intent(this,FormAudioTopActivity.class));
        startActivity(new Intent(this,FragmentContainerActivity.class));
//        startActivity(new Intent(this,TestHandler.class));
//        findViewById(R.id.start).setOnClickListener(this);
//        findViewById(R.id.stop).setOnClickListener(this);
//        findViewById(R.id.over).setOnClickListener(this);
//        tv = (TextView) findViewById(R.id.tvshow);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.start:
                Intent intent = new Intent(MainActivity.this, RecorderService.class);
                startService(intent);
                break;
            case R.id.stop:
                break;
            case R.id.over:
                break;
        }
    }

    public static void test1(){
        File file1 = new File(".\\test1.txt");
        File file2 = new File("D:\\workspace\\test\\test1.txt");
        System.out.println("-----默认相对路径：取得路径不同------");
        System.out.println(file1.getPath());
        System.out.println(file1.getAbsolutePath());
        System.out.println("-----默认绝对路径:取得路径相同------");
        System.out.println(file2.getPath());
        System.out.println(file2.getAbsolutePath());
    }

//    -----默认相对路径：取得路径不同------
//            .\test1.txt
//    D:\workspace\test\.\test1.txt
//    -----默认绝对路径:取得路径相同------
//    D:\workspace\test\test1.txt
//    D:\workspace\test\test1.txt

}
